<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    
    <h:body>
        <ui:composition template="templateGeneral.xhtml">
            <ui:define name="title">Moji predmeti</ui:define>
            <ui:define name="center">
                <h:form>
                    <p:dataTable id="semestar" var="predmet" value="#{studentBean.predmetList}" selectionMode="single" 
                                 selection="#{studentBean.selectedPredmet}" rowKey="#{predmet.sifra}" 
                                 emptyMessage="Nema predmeta za ovaj semestar">
                        
                        

                        
                        <p:column headerText="Šifra" style="font-weight: bold; width:80px" >  
                            <h:outputText value="#{predmet.sifra}"/>  
                        </p:column>  

                        <p:column headerText="Informacije" style="font-weight: bold; width:280px">  
                            <h:outputText value="#{predmet.naziv}"/>  
                        </p:column>  

                        <p:column headerText="Tip" style="font-weight: bold; width:80px">  
                            <h:outputText value="#{predmet.tip}"/> 
                        </p:column>

                        <p:column headerText="Espb" style="font-weight: bold; width:40px">  
                            <h:outputText value="#{predmet.espb}"/> 
                        </p:column>

                        <p:column headerText="Fond casova" style="font-weight: bold; width:120px">  
                            <h:outputText value="#{predmet.fondCasova}"/> 
                        </p:column>
                        
                        <p:column headerText="Semestar" style="font-weight: bold; width:40px">  
                            <h:outputText value="#{predmet.semestar}"/> 
                        </p:column>
                        
                        <p:column headerText="Stranica predmeta" style="font-weight: bold; width:40px">  
                            <p:commandButton icon="ui-icon-circle-plus" action="#{predmetInfo.loadPredmet(predmet.sifra)}"/> 
                        </p:column>

                    </p:dataTable>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

